<template>
    <div style="width: 100%;height: 100%; min-width: 960px; min-height: 540px;" id="threejs"></div>
</template>

<script>
    import ThreeJs from "@/scripts/ThreeJs";

    export default {
        name: "HomePage",
        data() {
            return {
                app: null
            };
        },
        mounted() {
            this.init();
        },
        methods: {
            async init(){
                this.app = new ThreeJs("threejs");
                this.app.initThree();
                this.app.initController();
                // this.app.initHelper();
                const renderer=this.app.renderer;
                const scene=this.app.scene;
                const camera=this.app.camera;
                this.app.render(()=>{
                    renderer.render(scene,camera)
                })
            }
        }
    }
</script>

<style>
    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden; /* 防止出现滚动条 */
    }
</style>
